{% extends 'base.html' %}
{% block content %}
{% load static %}
    <div class="p-3">
        <div class="container">
            <div class="row mt-3">
                <div class="col mx-auto mb-3">
                    <h2>List of Movies</h2>
                    <hr />
                    <p class="card-text">
                        <form method="GET">
                            <div class="row">
                                <div class="col-auto">
                                    <div class="input-group col-auto">
                                        <div class="input-group-text">
                                            Search
                                        </div>
                                        <input type="text" class="form-control" name="search"/>
                                    </div>
                                </div>
                                <div class="col-auto">
                                    <button class="btn bg-dark text-white" type="submit">Search</button>
                                </div>
                            </div>
                        </form>
                    </p>
                </div>
            </div>
            <div class="row">
                {% for movie in template_data.movies %}
                    <div class="col-md-4 col-lg-3 mb-2">
                        <div class="p-2 card align-items-center pt-4">
                            <img src="{{ movie.image.url }}" alt="Movie" class="card-img-top rounded img-card-200" />
                            <div class="card-body text-center">
                                <a href="{% url 'movies.show' id=movie.id %}" class="btn bg-dark text-white">{{ movie.name }}</a>
                            </div>
                        </div>
                    </div>
                {% endfor %}
            </div>
        </div>
    </div>
{% endblock %}